package leetcode

//twoSum [2 7 3 5] target = 9
func twoSum(nums []int, target int) []int {
	m := make(map[int]int)
	for i, num := range nums {
		if t, ok := m[target-num]; ok {
			return []int{t, i}
		}
		m[num] = i
	}

	return nil
}
